package jtk.project4.fleet.field;

import java.awt.Dimension;

import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.control.CalendarControl;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.ComboField;
import nl.coderight.jazz.form.field.SpinnerField;
import nl.coderight.jazz.form.field.TextField;

public class InventoryDetailsField extends GroupControl
{
	private SpinnerField<Integer> CapacityField;
	private TextField CurrentLevelField;
	private SpinnerField<Integer>  ReorderLevelField;
	private CalendarControl LastRecDateField;
	
	
	public InventoryDetailsField(String bindID)
	{
		setTitle("header.InventoryDetails");
		setBindID(bindID);
		createFields();
		createLayout();
	}
	
	private void createFields()
	{
		CapacityField = new SpinnerField <Integer>("Capacity", "wow");
		CapacityField.setPreferredSize(new Dimension(166, 20));
		//CapacityField.setPreferredSize(CurrentLevelField.getPreferredSize());
	
		CurrentLevelField = new TextField ("CurrentLevel", 20);
		CurrentLevelField.setRequired(true);
		CurrentLevelField.setPreferredSize(new Dimension(166, 20));
		
		ReorderLevelField = new SpinnerField <Integer>(" ReorderLevel", "wow");
		ReorderLevelField.setPreferredSize(new Dimension(166, 20));
		//ReorderLevelField.setPreferredSize(CurrentLevelField.getPreferredSize());
		
		LastRecDateField = new CalendarControl("Calendar",20);
		LastRecDateField.setPreferredSize(new Dimension(166, 20));
		//LastRecDateField.setPreferredSize(CurrentLevelField.getPreferredSize());
	}
	
	private void createLayout()
	{
		setLayout(new FormLayout())
		.addLabel("label.Capacity").addField(CapacityField)
		.addRow()
		.addLabel("label.CurrentLevel").addField(CurrentLevelField)
		.addRow()
		.addLabel("label.ReorderLevel").addField(ReorderLevelField)
		.addRow()
		.addLabel("label.LastRecDate").addField(LastRecDateField)
		;	
	}
}

